package tree;

import javax.swing.*;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Sintree implements ActionListener {
	
	static int sintreepoints;
	int totalpoints = 40;
	boolean recentreset = false;
	
	public static int getsinpoints() {
		return sintreepoints;
	}
	
	Skill chao = Sinskills.chaos();
	Skill clea = Sinskills.cleave();
	Skill cyclon = Sinskills.cyclone();
	Skill endu = Sinskills.endurance();
	Skill dagger = Sinskills.dagger();
	Skill drleap = Sinskills.leap();
	Skill fatal = Sinskills.stab();
	Skill respo = Sinskills.res();
	Skill stor = Sinskills.storm();
	Skill penetra = Sinskills.pene();
	Skill shadwalk = Sinskills.blink();
	Skill acrobatic = Sinskills.acro();
	Skill bicy = Sinskills.bicycle();
	Skill dark = Sinskills.veil();
	Skill adr = Sinskills.adren();
	Skill drago = Sinskills.dragon();
	Skill whir = Sinskills.whirl();
	Skill siez = Sinskills.seize();
	Skill shstrike = Sinskills.shadstrike();
	Skill shdance = Sinskills.shaddance();
	Skill fortify = Sinskills.fort();
	Skill blada = Sinskills.blade();
	Skill invi = Sinskills.invig();
	Skill blood = Sinskills.cold();
	
	static JFrame frame;
	JPanel masterypanel, skills, row1,row2,row3,row4,row5,row6,row7, masrow1,masrow2,masrow3,
		masrow4,masrow5,masrow6,masrow7;
	JLabel acrobat, adrena, bicycle, bladedance, blink, chaoss, cleave, coldblood,
		crosscl, cyclone, dagmas, risedrag, enduran, forit, invigor,
		dleap, penetr, pursuit, pushback, respot, siezethe, shadowda,
		shadowstr, fstab, stormb,veilo, whirling, title1, title2, row1arr, info,
		row2arr, row3arr, row4arr1, row4arr2, row5arr,purs, push, cross, concen1, concen11,
		concen2, concen22, razor1, razor11, razor2, razor22, razor3, razor33;
	JButton acro, adren, bi, blade, walk, chaos, cleav, cold, cycl,
	dag, drag, endur, fort, invig, leap, pene, res, sieze, dance, resetall,
	strike, stab, storm, veil, whirl, reset, def, zerk, cleric, sorc, sin;
	
	static JPanel allpanels;
	
	public JPanel createContentPane (){
		
		totalpoints = 40;
		sintreepoints = 0;

        // We create a bottom JPanel to place everything on.
        allpanels = new JPanel();
        allpanels.setLayout(null);
        
        ToolTipManager.sharedInstance().setDismissDelay(Integer.MAX_VALUE);
         
        title1 = new JLabel("Actives/Passives");
        title1.setLocation(5, 0);
        title1.setSize(430,20);
        title1.setHorizontalAlignment(0);
        title1.setOpaque(true);
        title1.setBackground(Color.gray);
        allpanels.add(title1);
        
        title2 = new JLabel("Masteries");
        title2.setLocation(435, 0);
        title2.setSize(110,20);
        title2.setHorizontalAlignment(0);
        title2.setOpaque(true);
        title2.setBackground(Color.gray);
        allpanels.add(title2);
        
        skills = new JPanel();
        skills.setLayout(null);
        skills.setSize(430, 430);
        skills.setLocation(5,20);
        allpanels.add(skills);
        
        masterypanel = new JPanel();
        masterypanel.setLayout(null);
        masterypanel.setSize(110, 430);
        masterypanel.setLocation(435,20);
        allpanels.add(masterypanel);
        
        //masteries
        masrow1 = new JPanel();
        masrow1.setLayout(null);
        masrow1.setLocation(0, 0);
        masrow1.setSize(110, 60);
        masrow1.setBackground(Color.lightGray);
        masrow1.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, Color.BLACK));
        masterypanel.add(masrow1);
        
        ImageIcon img = new ImageIcon(getClass().getResource("/assassin/pursuit.png"));
        Image test = img.getImage();
        Image newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        
        //pursuit
        pursuit = new JLabel();
        pursuit.setSize(40,40);
        pursuit.setToolTipText("<html>Pursuit<br>Grants the Pursuit effect when dodging, increasing movement<br>" +
        					"speed by 3%. Certain Skills can consume pursuit to grant the finesse" +
        					"effect.<br>Requires 5+ points in assassin.</html>");
        pursuit.setLocation(10, 10);
        pursuit.setOpaque(true);
        pursuit.setBackground(new Color(128,128,128,175));
        masrow1.add(pursuit);
        
        purs = new JLabel((Icon) img);
        purs.setSize(40,40);
        purs.setLocation(10, 10);
        masrow1.add(purs);
        
        //pushback
        img = new ImageIcon(getClass().getResource("/assassin/pushback.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        pushback = new JLabel();
        pushback.setSize(40,40);
        pushback.setToolTipText("<html>PushBack<br>Grants the pushback effect until canceled, which causes cyclone<br>" +
        						"kick, bicycle kick, and rising dragon to push afflicted enemies away<br>" + 
        						"from you. Use this skill again to disable the effect.<br>Energy Cost: 75<br>Cooldown: 1 sec<br>" +
        						"Requires 5+ points in assassin</html>");
        pushback.setLocation(60, 10);
        pushback.setOpaque(true);
        pushback.setBackground(new Color(128,128,128,175));
        masrow1.add(pushback);
        
        push = new JLabel((Icon) img);
        push.setSize(40,40);
        push.setLocation(60, 10);
        masrow1.add(push);
        
        
        //masrow2
        masrow2 = new JPanel();
        masrow2.setLayout(null);
        masrow2.setLocation(0, 60);
        masrow2.setSize(110, 60);
        masrow2.setBackground(Color.lightGray);
        masrow2.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 1, Color.BLACK));
        masterypanel.add(masrow2);
        
        //crossclass
        img = new ImageIcon(getClass().getResource("/assassin/crossclass.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        cross = new JLabel();
        cross.setSize(40,40);
        cross.setToolTipText("<html>Style Mastery: Assassin<br>Allows you to learn skills of other styles<br>" +
        						"Requires 10+ points in assassin</html>");
        cross.setLocation(35, 10);
        cross.setOpaque(true);
        cross.setBackground(new Color(128,128,128,175));
        masrow2.add(cross);
        
        crosscl = new JLabel((Icon) img);
        crosscl.setSize(40,40);
        crosscl.setLocation(35, 10);
        masrow2.add(crosscl);
        
        //masrow3
        masrow3 = new JPanel();
        masrow3.setLayout(null);
        masrow3.setLocation(0, 120);
        masrow3.setSize(110, 60);
        masrow3.setBackground(Color.lightGray);
        masrow3.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 1, Color.BLACK));
        masterypanel.add(masrow3);
        
        //razor blade 1
        img = new ImageIcon(getClass().getResource("/assassin/razor.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        razor1 = new JLabel();
        razor1.setSize(40,40);
        razor1.setToolTipText("<html>Razor Blade<br>Increases Physical and Magical Critical rate by 2%.<br>" +
        						"Requires 15+ points in assassin");
        razor1.setLocation(35, 10);
        razor1.setOpaque(true);
        razor1.setBackground(new Color(128,128,128,175));
        masrow3.add(razor1);
        
        razor11 = new JLabel((Icon) img);
        razor11.setSize(40,40);
        razor11.setLocation(35, 10);
        masrow3.add(razor11);
        
      //masrow4
        masrow4 = new JPanel();
        masrow4.setLayout(null);
        masrow4.setLocation(0, 180);
        masrow4.setSize(110, 60);
        masrow4.setBackground(Color.lightGray);
        masrow4.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 1, Color.BLACK));
        masterypanel.add(masrow4);
        
      //Concentration 1
        img = new ImageIcon(getClass().getResource("/assassin/concentration.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        concen1 = new JLabel();
        concen1.setSize(40,40);
        concen1.setToolTipText("<html>Concentration<br>Allows the Pursuit Effect to stack 2 times.<br>" +
        						"Requires 20+ points in assassin");
        concen1.setLocation(35, 10);
        concen1.setOpaque(true);
        concen1.setBackground(new Color(128,128,128,175));
        masrow4.add(concen1);
        
        concen11 = new JLabel((Icon) img);
        concen11.setSize(40,40);
        concen11.setLocation(35, 10);
        masrow4.add(concen11);
        
      //masrow5
        masrow5 = new JPanel();
        masrow5.setLayout(null);
        masrow5.setLocation(0, 240);
        masrow5.setSize(110, 60);
        masrow5.setBackground(Color.lightGray);
        masrow5.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 1, Color.BLACK));
        masterypanel.add(masrow5);
        
        
      //razor blade 2
        img = new ImageIcon(getClass().getResource("/assassin/razor.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        razor2 = new JLabel();
        razor2.setSize(40,40);
        razor2.setToolTipText("<html>Razor Blade 2<br>Increases Physical and Magical Critical rate by 4%.<br>" +
        						"Requires 25+ points in assassin");
        razor2.setLocation(35, 10);
        razor2.setOpaque(true);
        razor2.setBackground(new Color(128,128,128,175));
        masrow5.add(razor2);
        
        razor22 = new JLabel((Icon) img);
        razor22.setSize(40,40);
        razor22.setLocation(35, 10);
        masrow5.add(razor22);
        
      //masrow6
        masrow6 = new JPanel();
        masrow6.setLayout(null);
        masrow6.setLocation(0, 300);
        masrow6.setSize(110, 60);
        masrow6.setBackground(Color.lightGray);
        masrow6.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 1, Color.BLACK));
        masterypanel.add(masrow6);
        
      //Concentration 2
        img = new ImageIcon(getClass().getResource("/assassin/concentration.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        concen2 = new JLabel();
        concen2.setSize(40,40);
        concen2.setToolTipText("<html>Concentration 2<br>Allows the Pursuit Effect to stack 3 times.<br>" +
        						"Requires 30+ points in assassin");
        concen2.setLocation(35, 10);
        concen2.setOpaque(true);
        concen2.setBackground(new Color(128,128,128,175));
        masrow6.add(concen2);
        
        concen22 = new JLabel((Icon) img);
        concen22.setSize(40,40);
        concen22.setLocation(35, 10);
        masrow6.add(concen22);
        
      //masrow7
        masrow7 = new JPanel();
        masrow7.setLayout(null);
        masrow7.setLocation(0, 360);
        masrow7.setSize(110, 60);
        masrow7.setBackground(Color.lightGray);
        masrow7.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 1, Color.BLACK));
        masterypanel.add(masrow7);
        
        
      //razor blade 3
        img = new ImageIcon(getClass().getResource("/assassin/razor.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        razor3 = new JLabel();
        razor3.setSize(40,40);
        razor3.setToolTipText("<html>Razor Blade 3<br>Increases Physical and Magical Critical rate by 6%.<br>" +
        						"Requires 35+ points in assassin");
        razor3.setLocation(35, 10);
        razor3.setOpaque(true);
        razor3.setBackground(new Color(128,128,128,175));
        masrow7.add(razor3);
        
        razor33 = new JLabel((Icon) img);
        razor33.setSize(40,40);
        razor33.setLocation(35, 10);
        masrow7.add(razor33);
        
        def = new JButton();
        def.setText("Defender(0)");
        def.setSize(110,20);
        def.setLocation(5, 450);
        def.setHorizontalAlignment( SwingConstants.LEFT );
        def.addActionListener(this);
        allpanels.add(def);
        
        zerk = new JButton();
        zerk.setText("Berserker(0)");
        zerk.setSize(120,20);
        zerk.setLocation(115, 450);
        zerk.setHorizontalAlignment( SwingConstants.LEFT );
        zerk.addActionListener(this);
        allpanels.add(zerk);
        
        cleric = new JButton();
        cleric.setText("Cleric(0)");
        cleric.setSize(90,20);
        cleric.setLocation(235, 450);
        cleric.setHorizontalAlignment( SwingConstants.CENTER );
        cleric.addActionListener(this);
        allpanels.add(cleric);
        
        sorc = new JButton();
        sorc.setText("Sorcerer(0)");
        sorc.setSize(110,20);
        sorc.setLocation(325, 450);
        sorc.setHorizontalAlignment( SwingConstants.LEFT );
        sorc.addActionListener(this);
        allpanels.add(sorc);
        
        sin = new JButton();
        sin.setText("Assassin(" + sintreepoints + ")");
        sin.setSize(110,20);
        sin.setLocation(435, 450);
        sin.setHorizontalAlignment( SwingConstants.LEFT );
        sin.addActionListener(this);
        allpanels.add(sin);
        
        
        info = new JLabel();
        info.setText("<html>Points Used: " + sintreepoints + "<br>Points Left: " + (totalpoints-(sintreepoints+Deftree.getdefpoints())) + "</html>");
        info.setSize(550,40);
        info.setHorizontalAlignment( SwingConstants.CENTER );
        info.setLocation(0, 470);
        allpanels.add(info);
        
        reset = new JButton("Reset Tree");
        reset.setSize(100, 20);
        reset.setLocation(225, 510);
        reset.setHorizontalAlignment( SwingConstants.CENTER );
        reset.addActionListener(this);
        allpanels.add(reset);
        
        resetall = new JButton("Reset All");
        resetall.setSize(100, 20);
        resetall.setLocation(225, 530);
        resetall.setHorizontalAlignment( SwingConstants.CENTER );
        resetall.addActionListener(this);
        allpanels.add(resetall);
        
        //row1
        row1 = new JPanel();
        row1.setLayout(null);
        row1.setLocation(0, 0);
        row1.setSize(430, 60);
        row1.setBackground(Color.lightGray);
        row1.setBorder(BorderFactory.createMatteBorder(0, 1, 1, 1, Color.BLACK));
        skills.add(row1);
        
        
        //chaos
        img = new ImageIcon(getClass().getResource("/assassin/chaos.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        chaos = new JButton((Icon) img);
        chaos.setToolTipText("<html>" + chao.popup() + "</html>");
        chaos.setSize(40, 40);
        chaos.setLocation(10, 10);
        chaos.addActionListener(this);
        row1.add(chaos);
        
        chaoss = new JLabel();
        chaoss.setText(chao.getlv() + "/" + chao.getmax());
        chaoss.setSize(20,20);
        chaoss.setLocation(50, 30);
        row1.add(chaoss);
        
        //cleave
        img = new ImageIcon(getClass().getResource("/assassin/cleave.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        cleav = new JButton((Icon) img);
        cleav.setToolTipText("<html>" + clea.popup() + "</html>");
        cleav.setSize(40,40);
        cleav.setLocation(80, 10);
        cleav.addActionListener(this);
        row1.add(cleav);
        
        cleave = new JLabel();
        cleave.setText(clea.getlv() + "/" + clea.getmax());
        cleave.setSize(20,20);
        cleave.setLocation(120, 30);
        row1.add(cleave);
        
        img = new ImageIcon(getClass().getResource("/assassin/rightarrow.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(20, 20,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        row1arr = new JLabel((Icon) img);
        row1arr.setSize(20,20);
        row1arr.setLocation(125, 10);
        row1.add(row1arr);
        
        //cyclone
        img = new ImageIcon(getClass().getResource("/assassin/cyclone.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        cycl = new JButton((Icon) img);
        cycl.setToolTipText("<html>" + cyclon.popup() + "</html>");
        cycl.setSize(40,40);
        cycl.setLocation(150, 10);
        cycl.addActionListener(this);
        row1.add(cycl);
        
        cyclone = new JLabel();
        cyclone.setText(cyclon.getlv() + "/" + cyclon.getmax());
        cyclone.setSize(20,20);
        cyclone.setLocation(190, 30);
        row1.add(cyclone);
        
        //endurance
        img = new ImageIcon(getClass().getResource("/assassin/endurance.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        endur = new JButton((Icon) img);
        endur.setToolTipText("<html>" + endu.popup() + "</html>");
        endur.setSize(40,40);
        endur.setLocation(290, 10);
        endur.addActionListener(this);
        row1.add(endur);
        
        enduran = new JLabel();
        enduran.setText(endu.getlv() + "/" + endu.getmax());
        enduran.setSize(20,20);
        enduran.setLocation(330, 30);
        row1.add(enduran);
        
        //dagger mastery
        img = new ImageIcon(getClass().getResource("/assassin/daggermastery.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        dag = new JButton((Icon) img);
        dag.setToolTipText("<html>" + dagger.popup() + "</html>");
        dag.setSize(40,40);
        dag.setLocation(360, 10);
        dag.addActionListener(this);
        row1.add(dag);
        
        dagmas = new JLabel();
        dagmas.setText(dagger.getlv() + "/" + dagger.getmax());
        dagmas.setSize(20,20);
        dagmas.setLocation(400, 30);
        row1.add(dagmas);
        
        //row2
        row2 = new JPanel();
        row2.setLayout(null);
        row2.setLocation(0, 60);
        row2.setSize(430, 60);
        row2.setBackground(Color.lightGray);
        row2.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.BLACK));
        skills.add(row2);
        
        //downarrow
        img = new ImageIcon(getClass().getResource("/assassin/downarrow.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(20, 58,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        row2arr = new JLabel((Icon) img);
        row2arr.setSize(20,58);
        row2arr.setLocation(20, 1);
        row2.add(row2arr);
        
        //leap
        img = new ImageIcon(getClass().getResource("/assassin/leap.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        leap = new JButton((Icon) img);
        leap.setToolTipText("<html>" + drleap.popup() + "</html>");
        leap.setSize(40,40);
        leap.setLocation(80, 10);
        leap.addActionListener(this);
        row2.add(leap);
        
        dleap = new JLabel();
        dleap.setText(drleap.getlv() + "/" + drleap.getmax());
        dleap.setSize(20,20);
        dleap.setLocation(120, 30);
        row2.add(dleap);
        
        //stab
        img = new ImageIcon(getClass().getResource("/assassin/stab.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        stab = new JButton((Icon) img);
        stab.setToolTipText("<html>" + fatal.popup() + "</html>");
        stab.setSize(40,40);
        stab.setLocation(220, 10);
        stab.addActionListener(this);
        row2.add(stab);
        
        fstab = new JLabel();
        fstab.setText(fatal.getlv() + "/" + fatal.getmax());
        fstab.setSize(20,20);
        fstab.setLocation(260, 30);
        row2.add(fstab);
        
        //Restoration Pot
        img = new ImageIcon(getClass().getResource("/assassin/res.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        res = new JButton((Icon) img);
        res.setToolTipText("<html>" + respo.popup() + "</html>");
        res.setSize(40,40);
        res.setLocation(290, 10);
        res.addActionListener(this);
        row2.add(res);
        
        respot = new JLabel();
        respot.setText(respo.getlv() + "/" + respo.getmax());
        respot.setSize(20,20);
        respot.setLocation(330, 30);
        row2.add(respot);
        
        //row3
        row3 = new JPanel();
        row3.setLayout(null);
        row3.setLocation(0, 120);
        row3.setSize(430, 60);
        row3.setBackground(Color.lightGray);
        row3.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.BLACK));
        skills.add(row3);
        
        //storm
        img = new ImageIcon(getClass().getResource("/assassin/storm.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        storm = new JButton((Icon) img);
        storm.setToolTipText("<html>" + stor.popup() + "</html>");
        storm.setSize(40,40);
        storm.setLocation(10, 10);
        storm.addActionListener(this);
        row3.add(storm);
        
        //avenaei
        stormb = new JLabel();
        stormb.setText(stor.getlv() + "/" + stor.getmax());
        stormb.setSize(20,20);
        stormb.setLocation(50, 30);
        row3.add(stormb);
        
        //penetrating
        img = new ImageIcon(getClass().getResource("/assassin/pene.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        pene = new JButton((Icon) img);
        pene.setToolTipText("<html>" + penetra.popup() + "</html>");
        pene.setSize(40,40);
        pene.setLocation(80, 10);
        pene.addActionListener(this);
        row3.add(pene);
        
        penetr = new JLabel();
        penetr.setText(penetra.getlv() + "/" + penetra.getmax());
        penetr.setSize(20,20);
        penetr.setLocation(120, 30);
        row3.add(penetr);
        
        //blink
        img = new ImageIcon(getClass().getResource("/assassin/blink.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        walk = new JButton((Icon) img);
        walk.setToolTipText("<html>" + shadwalk.popup() + "</html>");
        walk.setSize(40,40);
        walk.setLocation(220, 10);
        walk.addActionListener(this);
        row3.add(walk);
        
        blink = new JLabel();
        blink.setText(shadwalk.getlv() + "/" + shadwalk.getmax());
        blink.setSize(20,20);
        blink.setLocation(260, 30);
        row3.add(blink);
        
        //downarrow right
        img = new ImageIcon(getClass().getResource("/assassin/downarrow.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(20, 58,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        row3arr = new JLabel((Icon) img);
        row3arr.setSize(20,58);
        row3arr.setLocation(300, 1);
        row3.add(row3arr);
        
        //acro
        img = new ImageIcon(getClass().getResource("/assassin/acrobatics.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        acro = new JButton((Icon) img);
        acro.setToolTipText("<html>" + acrobatic.popup() + "</html>");
        acro.setSize(40,40);
        acro.setLocation(360, 10);
        acro.addActionListener(this);
        row3.add(acro);
        
        acrobat = new JLabel();
        acrobat.setText(acrobatic.getlv() + "/" + acrobatic.getmax());
        acrobat.setSize(20,20);
        acrobat.setLocation(400, 30);
        row3.add(acrobat);
        
        //row4
        row4 = new JPanel();
        row4.setLayout(null);
        row4.setLocation(0, 180);
        row4.setSize(430, 60);
        row4.setBackground(Color.lightGray);
        row4.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.BLACK));
        skills.add(row4);
        
        //downarrow
        img = new ImageIcon(getClass().getResource("/assassin/downarrow.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(20, 58,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        row4arr1 = new JLabel((Icon) img);
        row4arr1.setSize(20,58);
        row4arr1.setLocation(20, 1);
        row4.add(row4arr1);
        
        //downarrow
        img = new ImageIcon(getClass().getResource("/assassin/downarrow.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(20, 58,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        row2arr = new JLabel((Icon) img);
        row2arr.setSize(20,58);
        row2arr.setLocation(90, 1);
        row4.add(row2arr);
        
        //bicycle
        img = new ImageIcon(getClass().getResource("/assassin/bicycle.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        bi = new JButton((Icon) img);
        bi.setToolTipText("<html>" + bicy.popup() + "</html>");
        bi.setSize(40,40);
        bi.setLocation(150, 10);
        bi.addActionListener(this);
        row4.add(bi);
        
        bicycle = new JLabel();
        bicycle.setText(bicy.getlv() + "/" + bicy.getmax());
        bicycle.setSize(20,20);
        bicycle.setLocation(190, 30);
        row4.add(bicycle);
        
        //veil
        img = new ImageIcon(getClass().getResource("/assassin/veil.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        veil = new JButton((Icon) img);
        veil.setToolTipText("<html>" + dark.popup() + "</html>");
        veil.setSize(40,40);
        veil.setLocation(220, 10);
        veil.addActionListener(this);
        row4.add(veil);
        
        veilo = new JLabel();
        veilo.setText(dark.getlv() + "/" + dark.getmax());
        veilo.setSize(20,20);
        veilo.setLocation(260, 30);
        row4.add(veilo);
        
        //adrenaline pot
        img = new ImageIcon(getClass().getResource("/assassin/adren.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        adren = new JButton((Icon) img);
        adren.setToolTipText("<html>" + adr.popup() + "</html>");
        adren.setSize(40,40);
        adren.setLocation(290, 10);
        adren.addActionListener(this);
        row4.add(adren);
        
        adrena = new JLabel();
        adrena.setText(adr.getlv() + "/" + adr.getmax());
        adrena.setSize(20,20);
        adrena.setLocation(330, 30);
        row4.add(adrena);
        
        //row5
        row5 = new JPanel();
        row5.setLayout(null);
        row5.setLocation(0, 240);
        row5.setSize(430, 60);
        row5.setBackground(Color.lightGray);
        row5.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.BLACK));
        skills.add(row5);
        
        //Rising dragon
        img = new ImageIcon(getClass().getResource("/assassin/dragon.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        drag = new JButton((Icon) img);
        drag.setToolTipText("<html>" + drago.popup() + "</html>");
        drag.setSize(40,40);
        drag.setLocation(10, 10);
        drag.addActionListener(this);
        row5.add(drag);
        
        risedrag = new JLabel();
        risedrag.setText(drago.getlv() + "/" + drago.getmax());
        risedrag.setSize(20,20);
        risedrag.setLocation(50, 30);
        row5.add(risedrag);
        
        //Whirling Blade
        img = new ImageIcon(getClass().getResource("/assassin/whirl.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        whirl = new JButton((Icon) img);
        whirl.setToolTipText("<html>" + whir.popup() + "</html>");
        whirl.setSize(40,40);
        whirl.setLocation(80, 10);
        whirl.addActionListener(this);
        row5.add(whirl);
        
        whirling = new JLabel();
        whirling.setText(whir.getlv() + "/" + whir.getmax());
        whirling.setSize(20,20);
        whirling.setLocation(120, 30);
        row5.add(whirling);
        
        //downarrow
        img = new ImageIcon(getClass().getResource("/assassin/downarrow.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(20, 58,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        row5arr = new JLabel((Icon) img);
        row5arr.setSize(20,58);
        row5arr.setLocation(300, 1);
        row5.add(row5arr);
        
        //Sieze the moment
        img = new ImageIcon(getClass().getResource("/assassin/seize.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        sieze = new JButton((Icon) img);
        sieze.setToolTipText("<html>" + siez.popup() + "</html>");
        sieze.setSize(40,40);
        sieze.setLocation(360, 10);
        sieze.addActionListener(this);
        row5.add(sieze);
        
        siezethe = new JLabel();
        siezethe.setText(siez.getlv() + "/" + siez.getmax());
        siezethe.setSize(20,20);
        siezethe.setLocation(400, 30);
        row5.add(siezethe);
        
        //row6
        row6 = new JPanel();
        row6.setLayout(null);
        row6.setLocation(0, 300);
        row6.setSize(430, 60);
        row6.setBackground(Color.lightGray);
        row6.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.BLACK));
        skills.add(row6);
        
        //shadowstrike
        img = new ImageIcon(getClass().getResource("/assassin/shadowstrike.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        strike = new JButton((Icon) img);
        strike.setToolTipText("<html>" + shstrike.popup() + "</html>");
        strike.setSize(40,40);
        strike.setLocation(150, 10);
        strike.addActionListener(this);
        row6.add(strike);
        
        shadowstr = new JLabel();
        shadowstr.setText(shstrike.getlv() + "/" + shstrike.getmax());
        shadowstr.setSize(20,20);
        shadowstr.setLocation(190, 30);
        row6.add(shadowstr);
        
        //shadowdance
        img = new ImageIcon(getClass().getResource("/assassin/shadowdance.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        dance = new JButton((Icon) img);
        dance.setToolTipText("<html>" + shdance.popup() + "</html>");
        dance.setSize(40,40);
        dance.setLocation(220, 10);
        dance.addActionListener(this);
        row6.add(dance);
        
        shadowda = new JLabel();
        shadowda.setText(shdance.getlv() + "/" + shdance.getmax());
        shadowda.setSize(20,20);
        shadowda.setLocation(260, 30);
        row6.add(shadowda);
        
        //Fortifying Pot
        img = new ImageIcon(getClass().getResource("/assassin/fort.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        fort = new JButton((Icon) img);
        fort.setToolTipText("<html>" + fortify.popup() + "</html>");
        fort.setSize(40,40);
        fort.setLocation(290, 10);
        fort.addActionListener(this);
        row6.add(fort);
        
        forit = new JLabel();
        forit.setText(fortify.getlv() + "/" + fortify.getmax());
        forit.setSize(20,20);
        forit.setLocation(330, 30);
        row6.add(forit);
        
        //row7
        row7 = new JPanel();
        row7.setLayout(null);
        row7.setLocation(0, 360);
        row7.setSize(430, 60);
        row7.setBackground(Color.lightGray);
        row7.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.BLACK));
        skills.add(row7);
        
        //blade dance
        img = new ImageIcon(getClass().getResource("/assassin/bladedance.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        blade = new JButton((Icon) img);
        blade.setToolTipText("<html>" + blada.popup() + "</html>");
        blade.setSize(40,40);
        blade.setLocation(80, 10);
        blade.addActionListener(this);
        row7.add(blade);
        
        bladedance = new JLabel();
        bladedance.setText(blada.getlv() + "/" + blada.getmax());
        bladedance.setSize(20,20);
        bladedance.setLocation(120, 30);
        row7.add(bladedance);
        
        //invigoration
        img = new ImageIcon(getClass().getResource("/assassin/invig.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        invig = new JButton((Icon) img);
        invig.setToolTipText("<html>" + invi.popup() + "</html>");
        invig.setSize(40,40);
        invig.setLocation(290, 10);
        invig.addActionListener(this);
        row7.add(invig);
        
        invigor = new JLabel();
        invigor.setText(invi.getlv() + "/" + invi.getmax());
        invigor.setSize(20,20);
        invigor.setLocation(330, 30);
        row7.add(invigor);
        
        //cold blooded
        img = new ImageIcon(getClass().getResource("/assassin/coldblooded.png"));
        test = img.getImage();
        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
        img = new ImageIcon(newimg);
        cold = new JButton((Icon) img);
        cold.setToolTipText("<html>" + blood.popup() + "</html>");
        cold.setSize(40,40);
        cold.setLocation(360, 10);
        cold.addActionListener(this);
        row7.add(cold);
        
        coldblood = new JLabel();
        coldblood.setText(blood.getlv() + "/" + blood.getmax());
        coldblood.setSize(20,20);
        coldblood.setLocation(400, 30);
        row7.add(coldblood);
        
        
        
        
        allpanels.setOpaque(true);
        return allpanels;
	}
	
	public void updatesin() {
		int allpoints = (sintreepoints+Deftree.getdefpoints()+Clertree.getclerpoints()+Sorctree.getsorcpoints()+Zerktree.getzerkpoints());
		info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
		def.setText("Defender(" + Deftree.getdefpoints() + ")");
		cleric.setText("Cleric(" + Clertree.getclerpoints() + ")");
		sorc.setText("Sorcerer(" + Sorctree.getsorcpoints() + ")");
		zerk.setText("Berserker(" + Zerktree.getzerkpoints() + ")");
		
	}
	
	public void recentset() {
		recentreset = true;
	}
	
	public void actionPerformed(ActionEvent e) {
		
		int allpoints = (sintreepoints+Deftree.getdefpoints()+Clertree.getclerpoints()+Sorctree.getsorcpoints()+Zerktree.getzerkpoints());
		if(e.getSource() == reset) {
			sintreepoints = 0;
			//frame.setContentPane(demo.createContentPane());
	        //frame.setVisible(true);
	        Alltrees.resetsin();
			
        } else if(e.getSource() == def) {
			//sintreepoints = 0;
			//frame.setContentPane(demo.createContentPane());avenaei
	        //frame.setVisible(true);
        	recentreset = false;
	        Alltrees.switchdef(); 
			
        }	else if(e.getSource() == resetall) {
			//sintreepoints = 0;
			//frame.setContentPane(demo.createContentPane());
	        //frame.setVisible(true);
	        Alltrees.resetall(); 
			
        }else if(e.getSource() == cleric) {
			//sintreepoints = 0;
			//frame.setContentPane(demo.createContentPane());
	        //frame.setVisible(true);
        	recentreset = false;
	        Alltrees.switchcler(); 
			
        }else if(e.getSource() == sorc) {
			//sintreepoints = 0;
			//frame.setContentPane(demo.createContentPane());
	        //frame.setVisible(true);
        	recentreset = false;
	        Alltrees.switchsorc(); 
			
        }else if(e.getSource() == zerk) {
			//sintreepoints = 0;
			//frame.setContentPane(demo.createContentPane());
	        //frame.setVisible(true);
        	recentreset = false;
	        Alltrees.switchzerk(); 
			
        }
		//row1
		else if ((Deftree.getdefpoints() == 0 && Clertree.getclerpoints() == 0 && Sorctree.getsorcpoints() == 0 && Zerktree.getzerkpoints() == 0) || Deftree.getdefpoints() >= 10 || Clertree.getclerpoints() >= 10 ||
				sintreepoints >= 10 || Sorctree.getsorcpoints() >= 10 || recentreset || Zerktree.getzerkpoints() >= 10) {
			if(e.getSource() == chaos) {
			if (chao.getlv() < chao.getmax() && chao.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				chao.setcurlv(chao.getlv()+1);
				chaos.setToolTipText("<html>" + chao.popup() + "</html>");
				chaoss.setText(chao.getlv() + "/" + chao.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == cleav) {
			if (clea.getlv() < clea.getmax() && clea.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				clea.setcurlv(clea.getlv()+1);
				cleav.setToolTipText("<html>" + clea.popup() + "</html>");
				cleave.setText(clea.getlv() + "/" + clea.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == cycl) {
			if (cyclon.getlv() < cyclon.getmax() && cyclon.getpoints() <= sintreepoints && clea.getlv() > 0 && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				cyclon.setcurlv(cyclon.getlv()+1);
				cycl.setToolTipText("<html>" + cyclon.popup() + "</html>");
				cyclone.setText(cyclon.getlv() + "/" + cyclon.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == endur) {
			if (endu.getlv() < endu.getmax() && endu.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				endu.setcurlv(endu.getlv()+1);
				endur.setToolTipText("<html>" + endu.popup() + "</html>");
				enduran.setText(endu.getlv() + "/" + endu.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == dag) {
			if (dagger.getlv() < dagger.getmax() && dagger.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				dagger.setcurlv(dagger.getlv()+1);
				dag.setToolTipText("<html>" + dagger.popup() + "</html>");
				dagmas.setText(dagger.getlv() + "/" + dagger.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } //row 2
        else if(e.getSource() == leap) {
			if (drleap.getlv() < drleap.getmax() && drleap.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				drleap.setcurlv(drleap.getlv()+1);
				leap.setToolTipText("<html>" + drleap.popup() + "</html>");
				dleap.setText(drleap.getlv() + "/" + drleap.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == stab) {
			if (fatal.getlv() < fatal.getmax() && fatal.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				fatal.setcurlv(fatal.getlv()+1);
				stab.setToolTipText("<html>" + fatal.popup() + "</html>");
				fstab.setText(fatal.getlv() + "/" + fatal.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == res) {
			if (respo.getlv() < respo.getmax() && respo.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				respo.setcurlv(respo.getlv()+1);
				res.setToolTipText("<html>" + respo.popup() + "</html>");
				respot.setText(respo.getlv() + "/" + respo.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } //row3
        else if(e.getSource() == storm) {
			if (stor.getlv() < stor.getmax() && stor.getpoints() <= sintreepoints && totalpoints > allpoints && chao.getlv() > 0) {
				sintreepoints ++;
				allpoints ++;
				stor.setcurlv(stor.getlv()+1);
				storm.setToolTipText("<html>" + stor.popup() + "</html>");
				stormb.setText(stor.getlv() + "/" + stor.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == pene) {
			if (penetra.getlv() < penetra.getmax() && penetra.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				penetra.setcurlv(penetra.getlv()+1);
				pene.setToolTipText("<html>" + penetra.popup() + "</html>");
				penetr.setText(penetra.getlv() + "/" + penetra.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == walk) {
			if (shadwalk.getlv() < shadwalk.getmax() && shadwalk.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				shadwalk.setcurlv(shadwalk.getlv()+1);
				walk.setToolTipText("<html>" + shadwalk.popup() + "</html>");
				blink.setText(shadwalk.getlv() + "/" + shadwalk.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == acro) {
			if (acrobatic.getlv() < acrobatic.getmax() && acrobatic.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				acrobatic.setcurlv(acrobatic.getlv()+1);
				acro.setToolTipText("<html>" + acrobatic.popup() + "</html>");
				acrobat.setText(acrobatic.getlv() + "/" + acrobatic.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } //row4
        else if(e.getSource() == bi) {
			if (bicy.getlv() < bicy.getmax() && bicy.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				bicy.setcurlv(bicy.getlv()+1);
				bi.setToolTipText("<html>" + bicy.popup() + "</html>");
				bicycle.setText(bicy.getlv() + "/" + bicy.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == veil) {
			if (dark.getlv() < dark.getmax() && dark.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				dark.setcurlv(dark.getlv()+1);
				veil.setToolTipText("<html>" + dark.popup() + "</html>");
				veilo.setText(dark.getlv() + "/" + dark.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == adren) {
			if (adr.getlv() < adr.getmax() && adr.getpoints() <= sintreepoints && totalpoints > allpoints && respo.getlv() > 0) {
				sintreepoints ++;
				allpoints ++;
				adr.setcurlv(adr.getlv()+1);
				adren.setToolTipText("<html>" + adr.popup() + "</html>");
				adrena.setText(adr.getlv() + "/" + adr.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } //row5
        else if(e.getSource() == drag) {
			if (drago.getlv() < drago.getmax() && drago.getpoints() <= sintreepoints && totalpoints > allpoints && stor.getlv() > 0) {
				sintreepoints ++;
				allpoints ++;
				drago.setcurlv(drago.getlv()+1);
				drag.setToolTipText("<html>" + drago.popup() + "</html>");
				risedrag.setText(drago.getlv() + "/" + drago.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == whirl) {
			if (whir.getlv() < whir.getmax() && whir.getpoints() <= sintreepoints && totalpoints > allpoints && penetra.getlv() > 0) {
				sintreepoints ++;
				allpoints ++;
				whir.setcurlv(whir.getlv()+1);
				whirl.setToolTipText("<html>" + whir.popup() + "</html>");
				whirling.setText(whir.getlv() + "/" + whir.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == sieze) {
			if (siez.getlv() < siez.getmax() && siez.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				siez.setcurlv(siez.getlv()+1);
				sieze.setToolTipText("<html>" + siez.popup() + "</html>");
				siezethe.setText(siez.getlv() + "/" + siez.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } //row6
        else if(e.getSource() == strike) {
			if (shstrike.getlv() < shstrike.getmax() && shstrike.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				shstrike.setcurlv(shstrike.getlv()+1);
				strike.setToolTipText("<html>" + shstrike.popup() + "</html>");
				shadowstr.setText(shstrike.getlv() + "/" + shstrike.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == dance) {
			if (shdance.getlv() < shdance.getmax() && shdance.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				shdance.setcurlv(shdance.getlv()+1);
				dance.setToolTipText("<html>" + shdance.popup() + "</html>");
				shadowda.setText(shdance.getlv() + "/" + shdance.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        }
        else if(e.getSource() == fort) {
			if (fortify.getlv() < fortify.getmax() && fortify.getpoints() <= sintreepoints && totalpoints > allpoints && adr.getlv() > 0) {
				sintreepoints ++;
				allpoints ++;
				fortify.setcurlv(fortify.getlv()+1);
				fort.setToolTipText("<html>" + fortify.popup() + "</html>");
				forit.setText(fortify.getlv() + "/" + fortify.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } //row7
        else if(e.getSource() == blade) {
			if (blada.getlv() < blada.getmax() && blada.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				blada.setcurlv(blada.getlv()+1);
				blade.setToolTipText("<html>" + blada.popup() + "</html>");
				bladedance.setText(blada.getlv() + "/" + blada.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == invig) {
			if (invi.getlv() < invi.getmax() && invi.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				invi.setcurlv(invi.getlv()+1);
				invig.setToolTipText("<html>" + invi.popup() + "</html>");
				invigor.setText(invi.getlv() + "/" + invi.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } else if(e.getSource() == cold) {
			if (blood.getlv() < blood.getmax() && blood.getpoints() <= sintreepoints && totalpoints > allpoints) {
				sintreepoints ++;
				allpoints ++;
				blood.setcurlv(blood.getlv()+1);
				cold.setToolTipText("<html>" + blood.popup() + "</html>");
				coldblood.setText(blood.getlv() + "/" + blood.getmax());
				info.setText("<html>Points Used: " + allpoints + "<br>Points Left: " + (totalpoints-allpoints) + "</html>");
			} 
        } }
		
        
		if (sintreepoints == 5) {
			ImageIcon img = new ImageIcon(getClass().getResource("/assassin/pursuit.png"));
	        Image test = img.getImage();
	        Image newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
	        img = new ImageIcon(newimg);
	        pursuit.setIcon((Icon) img);
	        img = new ImageIcon(getClass().getResource("/assassin/pushback.png"));
	        test = img.getImage();
	        newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
	        img = new ImageIcon(newimg);
			pushback.setIcon((Icon) img);
		}
		if (sintreepoints == 10) {
			ImageIcon img = new ImageIcon(getClass().getResource("/assassin/crossclass.png"));
	        Image test = img.getImage();
	        Image newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
	        img = new ImageIcon(newimg);
	        cross.setIcon((Icon) img);
	        recentreset = false;
		}
		if (sintreepoints == 15) {
			ImageIcon img = new ImageIcon(getClass().getResource("/assassin/razor.png"));
	        Image test = img.getImage();
	        Image newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
	        img = new ImageIcon(newimg);
	        razor1.setIcon((Icon) img);
		} 
		if (sintreepoints == 20) {
			ImageIcon img = new ImageIcon(getClass().getResource("/assassin/concentration.png"));
	        Image test = img.getImage();
	        Image newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
	        img = new ImageIcon(newimg);
	        concen1.setIcon((Icon) img);
		} 
		
		if (sintreepoints == 25) {
			ImageIcon img = new ImageIcon(getClass().getResource("/assassin/razor.png"));
	        Image test = img.getImage();
	        Image newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
	        img = new ImageIcon(newimg);
	        razor2.setIcon((Icon) img);
		}
		if (sintreepoints == 30) {
			ImageIcon img = new ImageIcon(getClass().getResource("/assassin/concentration.png"));
	        Image test = img.getImage();
	        Image newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
	        img = new ImageIcon(newimg);
	        concen2.setIcon((Icon) img);
		} 
		
		if (sintreepoints == 35) {
			ImageIcon img = new ImageIcon(getClass().getResource("/assassin/razor.png"));
	        Image test = img.getImage();
	        Image newimg = test.getScaledInstance(40, 40,  java.awt.Image.SCALE_SMOOTH);
	        img = new ImageIcon(newimg);
	        razor3.setIcon((Icon) img);
		} 
		sin.setText("Assassin(" + sintreepoints + ")");
		allpoints = (sintreepoints+Deftree.getdefpoints()+Clertree.getclerpoints()+Sorctree.getsorcpoints()+Zerktree.getzerkpoints());
		if (allpoints == 40) {
			if (sintreepoints < 10 && Clertree.getclerpoints() < 10 && Sorctree.getsorcpoints() < 10 && Deftree.getdefpoints() < 10 && 
					Zerktree.getzerkpoints() < 10) {
				JOptionPane.showMessageDialog (null, "Error: Invalid Tree\nNone of the class trees has at least 10 points\n" +
						"Reseting",
		        			"Invalid", JOptionPane.ERROR_MESSAGE);
				Alltrees.resetall();
			}
		}
		
		
		
	}
	
	private static void createAndShowGUI() {

        JFrame.setDefaultLookAndFeelDecorated(true);
        frame = new JFrame("Assassin Skill Tree  by Avenaei(Andrew)");

        //Create and set up the content pane.
        Sintree demo = new Sintree();
        frame.setContentPane(demo.createContentPane());

        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(560, 600);
        Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
        frame.setLocation((dim.width/2)-(frame.getSize().width/2), dim.height/2-frame.getSize().height/2);
        frame.setVisible(true);
    }
	public static void main(String[] args) {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
            }
        });
    }

}
